import Vue from "vue";
import Router from "vue-router";
import Layout from "@/layout/index.vue";

Vue.use(Router);

/*
  redirect:                      if set to 'noredirect', no redirect action will be trigger when clicking the breadcrumb
  meta: {
    title: 'title'               the name showed in subMenu and breadcrumb (recommend set)
    icon: 'svg-name'             the icon showed in the sidebar
    breadcrumb: false            if false, the item will be hidden in breadcrumb (default is true)
    hidden: true                 if true, this route will not show in the sidebar (default is false)
  }
*/

export default new Router({
  // mode: 'history',  // Enable this if you need.
  scrollBehavior: (to, from, savedPosition) => {
    if (savedPosition) {
      return savedPosition;
    } else {
      return { x: 0, y: 0 };
    }
  },
  // base: process.env.BASE_URL,
  base: "/drgweb", //tomcat配置
  routes: [
    {
      path: "/login",
      component: () => import("@/views/login/index.vue"),
      meta: { hidden: true, title: "登录" },
    },
    {
      path: "/pathPage",
      component: () => import("@/views/pathPage/index.vue"),
      meta: { hidden: true, title: "变异详情" },
    },
    {
      path: "/404",
      component: () => import(/* webpackChunkName: "404" */ "@/views/404.vue"),
      meta: { hidden: true },
    },
    {
      path: "/",
      component: Layout,
      redirect: "/dashboard",
      meta: {
        id: "001",
      },
      children: [
        {
          path: "dashboard",
          name: "dashboard",
          // component: (resolve) => require(['@/views/dashboard/index.vue'], resolve),
          component: () => import("@/views/dashboard/index.vue"),
          meta: {
            title: "主页",
            icon: "dashboard",
            id: "001001",
            keepAlive: true,
          },
        },
      ],
    },
    {
      path: "/clinicalpathway",
      component: Layout,
      redirect: "/clinicalpathway/user",
      meta: {
        title: "临床路径",
        icon: "nested",
        id: "002"
      },
      children: [
        {
          path: "user",
          name: "user",
          component: () => import("@/views/clinicalpathway/user/index.vue"),
          meta: {
            title: "入组清单",
            icon: "user",
            id: "002001",
            keepAlive: true,
          },
        },
        {
          path: "user2warn",
          name: "user2warn",
          component: () => import("@/views/clinicalpathway/user2warn/index.vue"),
          meta: {
            title: "有盈余风险的病例评估",
            icon: "user",
            id: "002001",
            keepAlive: true,
          },
        },
        {
          path: "user2warn2",
          name: "user2warn2",
          component: () => import("@/views/clinicalpathway/user2warn/index.vue"),
          meta: {
            title: "有过度医疗风险的病例评估",
            icon: "user",
            id: "002001",
            keepAlive: true,
          },
        },
        {
          path: "designer",
          name: "designer",
          component: () => import("@/views/clinicalpathway/designer/index.vue"),
          meta: { title: "设计器", icon: "eye-on", hidden: true },
        },
        {
          path: "tpledit",
          name: "tpledit",
          component: () => import("@/views/clinicalpathway/tpl-edit/index.vue"),
          meta: { title: "编辑模板", icon: "eye-on", hidden: true },
        },
        {
          path: "useinfo",
          name: "useinfo",
          component: () => import("@/views/clinicalpathway/useinfo/index.vue"),
          meta: {
            title: "病例详情",
            hidden: true,
            activeMenu: "/clinicalpathway/user",
          },
        },
        {
          path: "template",
          name: "pathtemplate",
          component: () => import("@/views/clinicalpathway/template/index.vue"),
          meta: {
            title: "方案模板",
            icon: "table",
            id: "002002",
            keepAlive: false,
          },
        },
        {
          path: "templdif",
          name: "templdif",
          component: () => import("@/views/clinicalpathway/templ-dif/index.vue"),
          meta: {
            title: "模板对比",
            icon: "table",
            id: "002007",
            hidden: true,
          },
        },
        {
          path: "tpl-form",
          name: "tpl-form",
          component: () => import("@/views/clinicalpathway/tpl-form/index.vue"),
          meta: {
            title: "表单设计",
            icon: "form",
            id: "002003",
            keepAlive: true,
          },
        },
        {
          path: "ed-tpl-form",
          name: "edTplForm",
          component: () =>
            import("@/views/clinicalpathway/ed-tpl-form/index.vue"),
          meta: {
            title: "编辑路径表单模板",
            hidden: true,
            activeMenu: "/clinicalpathway/tpl-form",
          },
        },
        {
          path: "copy-tpl",
          name: "copyTpl",
          component: () => import("@/views/clinicalpathway/copy-tpl/index.vue"),
          meta: {
            title: "复制模板",
            hidden: true,
            activeMenu: "/clinicalpathway/template",
          },
        },
        // {
        //   path: 'abs',
        //   component: () => import('@/views/clinicalpathway/abs/index.vue'),
        //   meta: { title: '综合分析', icon: 'hamburger', id: '002003', keepAlive: true }
        // },

        // {
        //   path: 'edtp',
        //   name: 'edtp',
        //   component: () => import('@/views/clinicalpathway/edtp/index.vue'),
        //   meta: { title: '诊疗方案评价', icon: 'eye-on', id: '002005', keepAlive: true }
        // },

        {
          name: "evaluate",
          path: "evaluate",
          component: () => import("@/views/clinicalpathway/evaluate/index.vue"),
          meta: {
            title: "评价结果",
            icon: "table",
            hidden: true,
            activeMenu: "/clinicalpathway/user",
          },
        },
        {
          name: "evaluate2",
          path: "evaluate2",
          component: () =>
            import("@/views/clinicalpathway/evaluate2/index.vue"),
          meta: {
            title: "评价结果",
            icon: "table",
            hidden: true,
            activeMenu: "/clinicalpathway/user",
          },
        },

        {
          path: "drg-weight-ed",
          name: "drgweighted",
          component: () =>
            import("@/views/clinicalpathway/drg-weight-ed/index.vue"),
          meta: { title: "病组标杆维护", icon: "password", hidden: false },
        },
        {
          path: "zdjbbar",
          name: "zdjbbar",
          component: () => import("@/views/clinicalpathway/zdjb-bar/index.vue"),
          meta: { title: "重点疾病图标分析", hidden: true },
        },
        //drgwarning
      ],
    },
    {
      path: "/statistics",
      component: Layout,
      redirect: "/statistics/bzqs",
      meta: {
        title: "统计报表",
        icon: "form",
        id: "004",
      },
      children: [
        {
          path: "overview",
          name: "overview",
          component: () => import("@/views/statistics/overview/index.vue"),
          meta: {
            title: "全院总览",
            icon: "form",
          },
        },
        {
          path: "profit",
          name: "profit",
          component: () => import("@/views/statistics/profit/index.vue"),
          meta: {
            title: "病组权重盈亏分析",
            icon: "form",
          },
        },
        {
          path: "bzqs",
          name: "bzqs",
          component: () => import("@/views/statistics/bzqs/index.vue"),
          meta: {
            title: "病组盈亏趋势分析",
            icon: "link",
            id: "004001",
          },
        },
        {
          name: "bzqsInfo",
          path: "bzqsInfo",
          component: () => import("@/views/statistics/bzqs/bzqsInfo.vue"),
          meta: {
            title: "病组盈亏趋势详情",
            icon: "table",
            hidden: true,
            activeMenu: "/statistics/bzqs",
          },
        },
        {
          path: "zybrrjqk",
          name: "zybrrjqk",
          component: () => import("@/views/statistics/zybrrjqk/index.vue"),
          meta: {
            title: "在院病人入径情况",
            icon: "nested",
            id: "004002",
          },
        },
        {
          path: "mbsyltj",
          name: "mbsyltj",
          component: () => import("@/views/statistics/mbsyltj/index.vue"),
          meta: {
            title: "模板使用率统计",
            icon: "hamburger",
            id: "004003",
          },
        },
        {
          path: "drgrzmx",
          name: "drgrzmx",
          component: () => import("@/views/statistics/drgrzmx/index.vue"),
          meta: {
            title: "Drg结算情况",
            icon: "form",
            id: "004003",
          },
        },
        {
          path: "cost-struct",
          name: "coststruct",
          component: () =>
            import("@/views/clinicalpathway/cost-struct/index.vue"),
          meta: {
            title: "病组费用结构",
            icon: "hamburger",
            id: "002004",
            keepAlive: true,
          },
        },
        {
          path: "dgpe",
          name: "dgpe",
          component: () => import("@/views/clinicalpathway/dgpe/index.vue"),
          meta: {
            title: "病组绩效评价",
            icon: "link",
            id: "002006",
            keepAlive: true,
          },
        },
        {
          path: "pro-cmp",
          name: "proCmp",
          component: () => import("@/views/clinicalpathway/pro-cmp/index.vue"),
          meta: { title: "院内大数据对比", icon: "tree", hidden: false },
        },
        {
          path: "drg-warning",
          name: "drgwarning",
          component: () =>
            import("@/views/clinicalpathway/drg-warning/index.vue"),
          meta: { title: "DRG风险分析", icon: "nested", hidden: false },
        },
        {
          path: "drg-loss",
          name: "drgloss",
          component: () => import("@/views/clinicalpathway/drg-loss/index.vue"),
          meta: { title: "DRG亏损查询", icon: "eye-on", hidden: false },
        },
        {
          path: "drg-zdjb",
          name: "drgzdjb",
          component: () => import("@/views/clinicalpathway/zdjb/index.vue"),
          meta: { title: "重点疾病分析", icon: "eye-off", hidden: false },
        },
        {
          path: "expenseReport",
          name: "expenseReport",
          component: () => import("@/views/clinicalpathway/expenseReport/index.vue"),
          meta: { title: "中医费用占比统计", icon: "nested", hidden: false },
        },
        {
          path: "wksstj",
          name: "wksstj",
          component: () => import("@/views/statistics/wksstj/index.vue"),
          meta: { title: "外科组手术室开单统计表", icon: "nested", hidden: false },
        },
        {
          path: "zdkfxmfx",
          name: "zdkfxmfx",
          component: () => import("@/views/statistics/zdkfxmfx/index.vue"),
          meta: { title: "重点控费项目分析", icon: "nested", hidden: false },
        },
        {
          path: "jclcxm",
          name: "jclcxm",
          component: () => import("@/views/statistics/zdkfxmfx/index.vue"),
          meta: { title: "经常漏查的项目分析", icon: "nested", hidden: false, param: { t: '漏查' } },
        },
        //zdkfxmfx
      ],
    },
    {
      path: "/costManage",
      component: Layout,
      redirect: "/costManage/constService",
      meta: {
        title: "成本管理",
        icon: "form",
        id: "005",
      },
      children: [
        {
          path: "constService",
          name: "constService",
          component: () => import("@/views/costManage/constService/index.vue"),
          meta: {
            title: "成本维护",
            icon: "form",
          },
        },
        {
          path: "statisticsCost",
          name: "statisticsCost",
          component: () => import("@/views/costManage/statisticsCost/index.vue"),
          meta: {
            title: "成本统计",
            icon: "form",

          },
        },
        {
          path: "statisInfo",
          name: "statisInfo",
          component: () => import("@/views/costManage/statisticsCost/statisInfo.vue"),
          meta: {
            title: "统计详情",
            hidden: true,
            activeMenu: "/costManage/statisticsCost",
          },
        },
        {
          path: "statisInfoTwo",
          name: "statisInfoTwo",
          component: () => import("@/views/costManage/statisticsCost/statisInfoTwo.vue"),
          meta: {
            title: "详情",
            hidden: true,
            activeMenu: "/costManage/statisticsCost",
          },
        },
      ]
    },
    {
      path: "/sys",
      component: Layout,
      redirect: "/sys/user",
      meta: {
        title: "系统管理",
        icon: "tree",
        id: "003",
      },
      children: [
        {
          path: "user",
          name: "sysUser",
          component: () => import("@/views/sys/user/index.vue"),
          meta: {
            title: "用户信息",
            icon: "user",
            id: "003001",
          },
        },
        // {
        //   path: 'perm',
        //   component: () => import('@/views/sys/perm/index.vue'),
        //   meta: {
        //     title: '权限管理',
        //     icon: 'link',
        //     id: '003002',
        //   },
        //   children: [
        //     {
        //       path: 'edperm',
        //       name: 'edperm',
        //       component: () => import('@/views/sys/edperm/index.vue'),
        //       meta: {
        //         title: '编辑权限',
        //         hidden: true
        //       }
        //     },
        //   ]
        // },
        {
          path: "edperm",
          component: () => import("@/views/sys/edperm/index.vue"),
          meta: {
            title: "编辑权限",
            hidden: true,
          },
        },
        {
          path: "set",
          name: "sysSet",
          component: () => import("@/views/sys/set/index.vue"),
          meta: {
            title: "参数设置",
            icon: "form",
            id: "003003",
          },
        },
        {
          path: "ops",
          name: "sysOps",
          component: () => import("@/views/sys/sysops/index.vue"),
          meta: {
            title: "系统日志",
            icon: "user",
            id: "003004",
          },
        }
      ],
    },
    // {
    //   path: '/example',
    //   component: Layout,
    //   redirect: '/example/tree',
    //   meta: {
    //     title: 'Example',
    //     icon: 'example'
    //   },
    //   children: [
    //     {
    //       path: 'tree',
    //       component: () => import(/* webpackChunkName: "tree" */ '@/views/tree/index.vue'),
    //       meta: {
    //         title: 'Tree',
    //         icon: 'tree'
    //       }
    //     },
    //     {
    //       path: 'table',
    //       component: () => import(/* webpackChunkName: "table" */ '@/views/table/index.vue'),
    //       meta: {
    //         title: 'Table',
    //         icon: 'table'
    //       }
    //     }
    //   ]
    // },
    // {
    //   path: '/form',
    //   component: Layout,
    //   children: [
    //     {
    //       path: 'index',
    //       component: () => import(/* webpackChunkName: "form" */ '@/views/form/index.vue'),
    //       meta: {
    //         title: 'Form',
    //         icon: 'form'
    //       }
    //     }
    //   ]
    // },
    // {
    //   path: '/nested',
    //   component: Layout,
    //   redirect: '/nested/menu1',
    //   meta: {
    //     title: 'Nested',
    //     icon: 'nested'
    //   },
    //   children: [
    //     {
    //       path: 'menu1',
    //       component: () => import(/* webpackChunkName: "menu1" */ '@/views/nested/menu1/index.vue'),
    //       redirect: '/nested/menu1/menu1-1',
    //       meta: { title: 'Menu1' },
    //       children: [
    //         {
    //           path: 'menu1-1',
    //           component: () => import(/* webpackChunkName: "menu1-1" */ '@/views/nested/menu1/menu1-1/index.vue'),
    //           meta: { title: 'Menu1-1' }
    //         },
    //         {
    //           path: 'menu1-2',
    //           component: () => import(/* webpackChunkName: "menu1-2" */ '@/views/nested/menu1/menu1-2/index.vue'),
    //           redirect: '/nested/menu1/menu1-2/menu1-2-1',
    //           meta: { title: 'Menu1-2' },
    //           children: [
    //             {
    //               path: 'menu1-2-1',
    //               component: () => import(/* webpackChunkName: "menu1-2-1" */ '@/views/nested/menu1/menu1-2/menu1-2-1/index.vue'),
    //               meta: { title: 'Menu1-2-1' }
    //             },
    //             {
    //               path: 'menu1-2-2',
    //               component: () => import(/* webpackChunkName: "menu1-2-2" */ '@/views/nested/menu1/menu1-2/menu1-2-2/index.vue'),
    //               meta: { title: 'Menu1-2-2' }
    //             }
    //           ]
    //         },
    //         {
    //           path: 'menu1-3',
    //           component: () => import(/* webpackChunkName: "menu1-3" */ '@/views/nested/menu1/menu1-3/index.vue'),
    //           meta: { title: 'Menu1-3' }
    //         }
    //       ]
    //     },
    //     {
    //       path: 'menu2',
    //       component: () => import(/* webpackChunkName: "menu2" */ '@/views/nested/menu2/index.vue'),
    //       meta: { title: 'Menu2' }
    //     }
    //   ]
    // },
    // {
    //   path: 'external-link',
    //   component: Layout,
    //   children: [
    //     {
    //       path: 'https://github.com/Armour/vue-typescript-admin-template',
    //       meta: {
    //         title: 'External Link',
    //         icon: 'link'
    //       }
    //     }
    //   ]
    // },
    {
      path: "*",
      redirect: "/404",
      meta: { hidden: true },
    },
  ],
});
